package cn.lili.modules.config;

import com.api.PayApi;
import com.api.UserApi;
import com.api.UserPhpApi;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@RefreshScope
@Data
public class FySdkPhpConfig {

    @Value("${fw.php.secrect}")
    String secret;

    @Value("${fw.php.appid}")
    String appId;

    @Value("${fw.php.server_wallet}")
    String serverWallet;

    @Value("${fw.php.server_backend}")
    String serverBackend;

    @Bean
    public UserPhpApi userPhpApi() {
        UserPhpApi userPhpApi = new UserPhpApi();
        userPhpApi.init(serverBackend, appId, secret);
        return userPhpApi;
    }
}